/*
 * defines.h
 *
 * Created: 19.01.2014 17:33:26
 *  Author: Hf
 */ 



#ifndef DEFINES_H_
#define DEFINES_H_


//define clock frequency
#define F_CPU			4190000UL	// Diese Definition ist fuer <util/delay.h> notwendig

#include <asf.h>

#define TEST_MODE
#define TEST_SENSOR_MODE

//define states
#define IDLE			0
#define SURFACED		1
#define MENU			2
#define DIVE			3
//define menu_states
#define M_PREDIVE		0
#define M_SETWATCH		1
#define M_SETDIVE		2
#define M_DEMO			3
#define M_AFTERDIVE		4
#define M_LOGBOOK		5

//define constants
#define SWITCH_TO_DIVE		150		//pressure difference (in hPa) 
#define SWITCH_TO_SURFACED	75		//pressure difference (in hPa)
#define SURFACE_TIMER_LIMIT 30		//time (in s) after which state SURFACED will be left
#define SHUTDOWN_TIME		180		//time (in s) until shutdown
#define MAX_INTERVAL		120		//maximum surface interval (in s) until another dive starts

typedef struct{
	int no_deco_flag;
	int no_deco_time_minutes;
	int deco_depth_meters;
	int deco_time_minutes;
} deco_info_t;

typedef struct{
	uint16_t nr;
	uint8_t day;
	uint8_t month;
	uint16_t year;
	uint8_t hour;
	uint8_t min;
	uint8_t max_depth_m;
	uint8_t max_depth_dm;
	int8_t min_temp;
	uint16_t duration;
} log_info_t;

#endif /* DEFINES_H_ */